<?php
class Gallery_Form_AlbumEdit extends Gallery_Form_AlbumAdd {

	/**
	 * @var mixed
	 */
	protected $_treeValues;
	
	/**
	 * @param mixed $value
	 */
	public function setTreeValues($value) {
		$this->_treeValues = $value;
	}

	public function init() {
		parent::init();

		$this->getSubForm('seotab')
			 ->getElement('alias')
			 ->removeValidator('db_no_exsists')
			 ->addValidator(new Zend_Validate_Db_NoRecordExists('gallery_album','alias',array(
                'field' => 'id',
                'value' => $this->getPrimaryKey()
			 )));

		$this->getSubForm('categorytab')
			 ->getElement('tree')
			 ->setValue($this->_treeValues);
			 
		$this->getElement('action')->setLabel('Edytuj');
	}
}